# 冒泡排序
l = [1, 100, 2, 1, 2, 3, 4, 5, 1, 112, 3, 1112]

for i in range(len(l) - 1):
    for j in range(len(l) - i - 1):
        if l[j] > l[j + 1]:
            # 交换两个个变量的值
            l[j], l[j + 1] = l[j + 1], l[j]

print(l)

l = [1, 100, 2, 1, 2, 3, 4, 5, 1, 112, 3, 1112]
# 选择排序
for i in range(len(l) - 1):
    min_index = i
    for j in range(i + 1, len(l)):
        if l[j] < l[min_index]:
            min_index = j
    l[i], l[min_index] = l[min_index], l[i]

print(l)